/**
 * @file ConditionsLibrary.java
 * A static library class representing various medical conditions.
 *
 * @author ApertureScience
 */
package aperturescience.libraries;

/**
 * This static class holds all conditions that a patient can experience.
 * This is includes pains, injuries, diseases, chronic ailments, syndromes, and so on.
 * The class has a name and a description contained in two parallel arrays. 
 */
public class ConditionsLibrary {
	// DATA FIELSDS
	private static String[] names = { // names of all conditions
		/* For Project */
		// Cardiac
		"Hyperdynamic",
		"Normal",
		"Hypotensive",
	    //Respiratory
		"Acute Distress", 
		"Normal", 
		"Somnolent",
		// Renal
	    "Acute Tubular Necrosis", 
	    "Normal", 
	    "Pre-renal",
		/* Extraneous */
		// Broken Bones
		"broken leg",
		"broken wrist",
		// Diseases/Illness
		"cold",
		"influenza",
		// Pains
		"headache",
		"chest pain"
	};

	public static String[] descriptions = { /* descriptions of all conditions 
	 										 * this array must sync with name array*/
		// Broken Bones
		"broken leg",
		"broken wrist",
		// Diseases/Illness
		"the common cold",
		"influenza",
		// Pains
		"headache",
		"chest pain"
	};
	
	public static int LENGTH = names.length; // length of both arrays
	
	// ACCESSOR METHODS
	
 	/**
	 * Retrieves the name of condition specified by the index  
	 *
	 * @param condition 	The specific index of a name
	 * @returns String from names at the index, if it's a valid index;
	 * 			otherwise returns null
	 */
	public static String getConditionName(int condition)
	{
		if(condition >= 0 && condition < LENGTH)
			return names[condition];
		return null;
	}
	
 	/**
	 * @method getConditionDescription
	 * retrieves the description of condition specified by the index  
	 *
	 * @param condition 	an index of description
	 * @pre condition is initialized
	 * @returns a string from description at the index, if it's a valid index
	 * 			otherwise returns null
	 */
	public static String getConditionDescription(int condition)
	{
		if(condition >= 0 && condition < LENGTH)
			return descriptions[condition];
		return null;
	}
}
